package main

func singleNumber(nums []int) int {
	m := make(map[int]int)
	for _, v := range nums {
		count, ok := m[v]
		if !ok {
			m[v] = 1
		} else {
			m[v] = count + 1
		}
	}
	for k, v := range m {
		if v < 2 {
			return k
		}
	}
	return 0
}
